package com.appspot.aliga;

public enum League {

	Bundesliga_1_2011(1, "1. Bundesliga", "bl1", "2011", 34), Bundesliga_2_2011(
			2, "2. Bundesliga", "bl2", "2011", 34), Bundesliga_3_2011(3,
			"3. Bundesliga", "bl3", "2011", 34);

	private String name;
	private String season;
	private int gameDays;
	private int id;
	private String oldbShortcut;

	private League(int id, String name, String oldbShortcut, String season,
			int gameDays) {
		this.id = id;
		this.name = name;
		this.oldbShortcut = oldbShortcut;
		this.season = season;
		this.gameDays = gameDays;
	}

	@Override
	public String toString() {
		return "League[" + this.name + ", " + this.season + "]";
	}

	public static League forID(String leagueID) {
		try {
			int lid = Integer.parseInt(leagueID);

			switch (lid) {
			case 1:
				return Bundesliga_1_2011;
			case 2:
				return Bundesliga_2_2011;
			case 3:
				return Bundesliga_3_2011;
			default:
				break;
			}
		} catch (NumberFormatException e) {
			// nothing to do
		}
		return null;
	}

	public String getName() {
		return name;
	}

	public String getSeason() {
		return season;
	}

	public int getGameDays() {
		return gameDays;
	}

	public int getId() {
		return id;
	}

	public String getOldbShortcut() {
		return oldbShortcut;
	}

}
